unit ucAgreementWorkman;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, ComCtrls, ToolWin, Grids, DBGridEh, StdCtrls;

type
  TfcAgreementWorkman = class(TFrame)
    GroupBox5: TGroupBox;
    DBGridEh5: TDBGridEh;
    tbAgreementWorkman: TToolBar;
    tbAddAgreementWorkman: TToolButton;
    tbDelAgreementWorkman: TToolButton;
    procedure tbAddAgreementWorkmanClick(Sender: TObject);
    procedure tbDelAgreementWorkmanClick(Sender: TObject);
    procedure DBGridEh5KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

uses uDBData;

{$R *.dfm}

procedure TfcAgreementWorkman.tbAddAgreementWorkmanClick(Sender: TObject);
begin
  if(fDBData.dAgreement.DataSet.IsEmpty = False)then
  begin
    fDBData.InsertRecord(fDBData.dAgreementWorkman);
  end;
end;

procedure TfcAgreementWorkman.tbDelAgreementWorkmanClick(Sender: TObject);
begin
  fDBData.DeleteRecord(fDBData.dAgreementWorkman);
end;

procedure TfcAgreementWorkman.DBGridEh5KeyPress(Sender: TObject;
  var Key: Char);
begin
  if Key = #13 then (Sender as TDBGridEh).DataSource.DataSet.Post;
end;

end.
